package xhwl.hmo.mall.http.api;


import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.hmo.mall.http.ApiService;
import xhwl.retrofitrx.BaseApi;


public class ProductsCommentApi extends BaseApi {
    ProductsCommentReq req;

    public ProductsCommentApi(int page_num, String goods_id) {
        req = new ProductsCommentReq(page_num, goods_id);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).getProductsComment(requestBody);
    }

    public class ProductsCommentReq {
        private int page_num;
        private String goods_id;

        public ProductsCommentReq(int page_num, String goods_id) {
            this.page_num = page_num;
            this.goods_id = goods_id;
        }
    }
}
